<div class="detail-page"
     ng-controller="horizon.dashboard.admin.ironic.NodeDetailsController as ctrl">

  <div class="pull-right">
    <button class="btn btn-default btn-sm"
            style="margin-right:10px;"
            ng-click="ctrl.refresh()">
      <span translate>Refresh</span>
    </button>
    <action-list uib-dropdown>
      <action button-type="split-button"
              action-classes="'btn btn-default btn-sm'"
              callback="ctrl.editNode">
        {$ ::'Edit' | translate $}
      </action>
      <menu>
        <li role="presentation"
            ng-repeat="transition in ctrl.nodePowerTransitions">
          <a role="menuitem"
             ng-click="ctrl.actions.setPowerState(
                       [ctrl.node],
                       transition.state,
                       transition.soft);
                       $event.stopPropagation();
                       $event.preventDefault()">
            <span>{$ transition.label $}</span>
          </a>
        </li>
        <li role="presentation">
          <a role="menuitem"
             ng-click="ctrl.maintenanceService.setMaintenance(
                       [ctrl.node],
                       !ctrl.node.maintenance);
                       $event.stopPropagation();
                       $event.preventDefault()">
            <span>{$ ctrl.node.maintenance ?
              "Maintenance Off" : "Maintenance On" | translate $}</span>
          </a>
        </li>
        <li role="presentation">
          <a role="menuitem"
             ng-click="ctrl.bootDeviceService.setBootDevice(ctrl.node);
                       $event.stopPropagation();
                       $event.preventDefault()">
            <span>{$ "Set Boot Device" | translate $}</span>
          </a>
        </li>
        <li role="presentation">
          <a role="menuitem"
             ng-click="ctrl.raidConfigService.setRaidConfig(ctrl.node);
                       $event.stopPropagation();
                       $event.preventDefault()">
            <span>{$ "Set RAID Configuration" | translate $}</span>
          </a>
        </li>
        <li role="presentation"
            ng-repeat="transition in ctrl.nodeStateTransitions">
          <a role="menuitem"
             ng-click="ctrl.actions.setProvisionState({
                       node: ctrl.node,
                       verb: transition.verb});
                       $event.stopPropagation();
                       $event.preventDefault()">
            <span>{$ transition.label $}</span>
          </a>
        </li>
        <action button-type="menu-item"
                disabled="isDefined(ctrl.nodeValidationMap.console)
                          && ctrl.nodeValidationMap.console.result===false"
                callback="ctrl.toggleConsoleMode">
          {$ ctrl.node.console_enabled ? 'Disable Console' : 'Enable Console' | translate $}
        </action>
        <li role="presentation">
          <a role="menuitem"
             ng-click="ctrl.injectNmi();
                       $event.stopPropagation();
                       $event.preventDefault()">
            <span>{$ "Inject NMI" | translate $}</span>
          </a>
        </li>
      </menu>
    </action-list>
  </div>

  <div class="clearfix"></div>

  <uib-tabset>
    <uib-tab ng-repeat="section in ctrl.sections"
         heading="{$ section.heading $}">
      <ng-include src="section.templateUrl"></ng-include>
    </uib-tab>
  </uib-tabset>
</div>
